package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiMtnclientOamMapper;
import com.ruoyi.net.domain.ElementBusiMtnclientOam;
import com.ruoyi.net.service.IElementBusiMtnclientOamService;

/**
 * 网元-业务-mtnclient-oamService业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiMtnclientOamServiceImpl implements IElementBusiMtnclientOamService 
{
    @Autowired
    private ElementBusiMtnclientOamMapper elementBusiMtnclientOamMapper;

    /**
     * 查询网元-业务-mtnclient-oam
     * 
     * @param id 网元-业务-mtnclient-oam主键
     * @return 网元-业务-mtnclient-oam
     */
    @Override
    public ElementBusiMtnclientOam selectElementBusiMtnclientOamById(String id)
    {
        return elementBusiMtnclientOamMapper.selectElementBusiMtnclientOamById(id);
    }

    /**
     * 查询网元-业务-mtnclient-oam列表
     * 
     * @param elementBusiMtnclientOam 网元-业务-mtnclient-oam
     * @return 网元-业务-mtnclient-oam
     */
    @Override
    public List<ElementBusiMtnclientOam> selectElementBusiMtnclientOamList(ElementBusiMtnclientOam elementBusiMtnclientOam)
    {
        return elementBusiMtnclientOamMapper.selectElementBusiMtnclientOamList(elementBusiMtnclientOam);
    }

    /**
     * 新增网元-业务-mtnclient-oam
     * 
     * @param elementBusiMtnclientOam 网元-业务-mtnclient-oam
     * @return 结果
     */
    @Override
    public int insertElementBusiMtnclientOam(ElementBusiMtnclientOam elementBusiMtnclientOam)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMtnclientOam.getId())) {
            elementBusiMtnclientOam.setId(uuid);
        }
        elementBusiMtnclientOam.setCreateBy(SecurityUtils.getUsername());
        elementBusiMtnclientOam.setCreateTime(DateUtils.getNowDate());
        elementBusiMtnclientOam.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnclientOam.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnclientOamMapper.insertElementBusiMtnclientOam(elementBusiMtnclientOam);
    }

    /**
     * 修改网元-业务-mtnclient-oam
     * 
     * @param elementBusiMtnclientOam 网元-业务-mtnclient-oam
     * @return 结果
     */
    @Override
    public int updateElementBusiMtnclientOam(ElementBusiMtnclientOam elementBusiMtnclientOam)
    {
        elementBusiMtnclientOam.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnclientOam.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnclientOamMapper.updateElementBusiMtnclientOam(elementBusiMtnclientOam);
    }

    /**
     * 批量删除网元-业务-mtnclient-oam
     * 
     * @param ids 需要删除的网元-业务-mtnclient-oam主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnclientOamByIds(String[] ids)
    {
        return elementBusiMtnclientOamMapper.deleteElementBusiMtnclientOamByIds(ids);
    }

    /**
     * 删除网元-业务-mtnclient-oam信息
     * 
     * @param id 网元-业务-mtnclient-oam主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnclientOamById(String id)
    {
        return elementBusiMtnclientOamMapper.deleteElementBusiMtnclientOamById(id);
    }
}
